package com.greenantmall.bean;

import com.avos.avoscloud.AVACL;
import com.avos.avoscloud.AVClassName;

@AVClassName(AntAVObject.CLASS_EMCOMPANY)
public class EMCompany extends AntAVObject {
	public static final String ATTR_NAME = "name";
	public static final String ATTR_IMAGE = "image";

	public EMCompany() {
		super();
		setAccessCtrl();
	}

	public EMCompany(String str) {
		super(str);
		setAccessCtrl();
	}

	public String getCompanyName() {
		String name = this.getString(ATTR_NAME);
		return (name == null ? "" : name);
	}

	public void setCompanyName(String name) {
		this.put(ATTR_NAME, name);
	}

	public String getCompanyImageUrl() {
		try {
			return this.getAVFile(ATTR_IMAGE).getUrl();
		} catch (Exception e) {
			e.printStackTrace();
		}
		return "";
	}

	private int setAccessCtrl() {
		acl = new AVACL();
		acl.setPublicReadAccess(true);
		acl.setPublicWriteAccess(false);
		return 0;
	}

}
